home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / pcl4c34.zip / PCL4C.REF < prev    next >
Text File  |  1993-01-01  |  61KB  |  2,283 lines

  1.  
  2.  
  3.                           Personal Communications Library
  4.  
  5.                                 For the C Language
  6.  
  7.  
  8.                                     (PCL4C)
  9.  
  10.  
  11.  
  12.                                REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                   Version  3.4
  19.  
  20.                                   Jan 4,  1993
  21.  
  22.  
  23.  
  24.  
  25.                         This software is provided as-is.
  26.                  There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                               Copyright (C) 1993
  32.                               All rights reserved
  33.  
  34.  
  35.  
  36.                               MarshallSoft Computing, Inc.
  37.                               Post Office Box 4543
  38.                               Huntsville AL 35815
  39.  
  40.                               Voice 205-881-4630
  41.                               FAX   205-881-4630
  42.                               BBS   205-880-9748
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.         PCL4C Reference Manual                                 Page 1
  61.                                C O N T E N T S
  62.  
  63.  
  64.  
  65.               Chapter                                     Page
  66.  
  67.               Table of Contents.............................2
  68.               Introduction..................................3
  69.                  SioBaud....................................4
  70.                  SioBrkKey..................................5
  71.                  SioBrkSig..................................6
  72.                  SioCrtWrite................................7
  73.                  SioCTS.....................................8
  74.                  SioDCD.....................................9
  75.                  SioDelay..................................10
  76.                  SioDone...................................11
  77.                  SioDSR....................................12
  78.                  SioDTR....................................13
  79.                  SioError..................................14
  80.                  SioFIFO...................................15
  81.                  SioFlow...................................16
  82.                  SioGetc...................................17
  83.                  SioKeyPress...............................18
  84.                  SioKeyRead................................19
  85.                  SioInfo...................................20
  86.                  SioIRQ....................................21
  87.                  SioLine...................................22
  88.                  SioLoopBack...............................23
  89.                  SioModem..................................24
  90.                  SioParms..................................25
  91.                  SioPutc...................................26
  92.                  SioRead...................................27
  93.                  SioReset..................................28
  94.                  SioRI.....................................29
  95.                  SioRTS....................................30
  96.                  SioRxBuf..................................31
  97.                  SioRxFlush................................32
  98.                  SioRxQue..................................33
  99.                  SioTimer..................................34
  100.                  SioUART...................................35
  101.                  SioUnGetc.................................36
  102.               Function Summary.............................37
  103.               Error Code Summary...........................38
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.         PCL4C Reference Manual                                 Page 2
  121.                                   Introduction
  122.  
  123.  
  124.  
  125.          This manual lists all of the PCL4C functions in alphabetical
  126.          order. Every library function will return a value as follows:
  127.  
  128.          1.  Negative values for error conditions. See last page of this
  129.          manual for a list of error values and their meanings.
  130.  
  131.          2.  Non-negative values when returning data (eg: SioLine).
  132.  
  133.          3.  Zero otherwise.
  134.  
  135.          When debugging an application, be sure to test all return values.
  136.          Use SioError to print the associated text for errors.
  137.  
  138.          Example Code Segment
  139.  
  140.  
  141.          *****************************************************************
  142.          * int Code;                 /* MUST be 'int', not 'char' */     *
  143.          *                                                               *
  144.          * Code = SioFunction( );    /* any PCL4C function */            *
  145.          * if(Code<0)                                                    *
  146.          *   {/* error returned */                                       *
  147.          *    SioError(Code);        /* SioError prints error text */    *
  148.          *    SioDone(Port);         /* always call SioDone last */      *
  149.          *    exit(1);                                                   *
  150.          *   }                                                           *
  151.          * /* no errors */                                               *
  152.          * ...your application code...                                   *
  153.          *                                                               *
  154.          *****************************************************************
  155.  
  156.  
  157.          For  more  examples, examine each of the example programs provided
  158.          (SIMPLE.C and TERM.C). Also look at the examples  associated  with
  159.          each library function described in the following section.
  160.  
  161.          Refer to the User's Manual (PCL4C.USR) for addition information.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.         PCL4C Reference Manual                                 Page 3
  181.                                   SioBaud
  182.  
  183.  
  184.  
  185.          Function    Sets the baud rate of the selected port.
  186.  
  187.            Syntax    int SioBaud(Port,BaudCode)
  188.                      int Port;     /* Port selected (COM1 - COM4) */
  189.                      int BaudCode; /* Baud code */
  190.  
  191.  
  192.           Remarks    The  SioBaud  function  sets  the  baud  rate  without
  193.                      resetting the port. It is used to change the baud rate
  194.                      after calling SioReset.
  195.  
  196.                      Baud Code           Baud Rate       PCL4C.H Name
  197.                           0                 300            Baud300
  198.                           1                 600            Baud600
  199.                           2                1200            Baud1200
  200.                           3                2400            Baud2400
  201.                           4                4800            Baud4800
  202.                           5                9600            Baud9600
  203.                           6               19200            Baud19200
  204.                           7               38400            Baud38400
  205.                           8               57600            Baud57600
  206.                           9              115200            Baud115200
  207.  
  208.  
  209.           Returns     -4 : Port out of range. Expected   0  to 3.
  210.                      -11 : Bad baud rate code. See above code values.
  211.  
  212.           Example    /* do auto baud detect */
  213.                      for(Code=0;Code<10;Code++)
  214.                        {/* set baud rate & transmit 'A' */
  215.                         SioBaud(Port,Code);
  216.                         SioPutc(Port,'A');
  217.                         /* assume other side echos back */
  218.                         if(SioGetc(Port,18)=='A'))
  219.                           {puts("Baud rate detected");
  220.                            /*...do something here...*/
  221.                           }
  222.                         }
  223.  
  224.          See Also    SioReset
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.         PCL4C Reference Manual                                 Page 4
  241.                                   SioBrkKey
  242.  
  243.  
  244.  
  245.          Function    Return non-zero if the Control-BREAK key was pressed.
  246.  
  247.            Syntax    int SioBrkKey()
  248.  
  249.           Remarks    The SioBrkKey function  returns  a  TRUE  value  (non-
  250.                      zero)  if  the  Control-BREAK key was pressed, else it
  251.                      returns a zero. Use SioBrkKey as a safety exit from  a
  252.                      polling   loop.   Don't  mix  this  function  up  with
  253.